const youxiaService = require("../service/youxia_service");
class youxiaController {
  // 获取热点资讯
  async getYouxiaGameNews(ctx, next) {
    const result = await youxiaService.getGameContent("news");
    ctx.body = result;
  }
  // 获取游戏测评
  async getYouxiaGameJudge(ctx, next) {
    const result = await youxiaService.getGameContent("judge");
    ctx.body = result;
  }
  // 获取游戏前瞻
  async getYouxiaGamePre(ctx, next) {
    const result = await youxiaService.getGameContent("pre");
    ctx.body = result;
  }
  // 获取游戏排行
  async getYouxiaGameRanking(ctx, next) {
    const result = await youxiaService.getGameRanking();
    ctx.body = result;
  }

  // 获取首页游戏卡片数据
  async getYouxiaGameCard(ctx, next) {
    const result = await youxiaService.getGameHomeCard();
    ctx.body = result;
  }

  // 获取steam在线人数排行榜
  async getYouxiaSteamRanking(ctx, next) {
    const result = await youxiaService.getSteamRanking();
    ctx.body = result;
  }

  // 获取近期大作数据
  async getYouxiaRecentGame(ctx, next) {
    const id = ctx.params.id;
    const result = await youxiaService.getRecentGameType(Number(id));
    ctx.body = result;
  }

  // 获取游侠top200 所有游戏
  async getYouxiaAllGame(ctx, next) {
    const page = ctx.params.page;
    const result = await youxiaService.getAllGames(page);
    ctx.body = result;
  }

  // 获取游戏测评卡片内容
  async getYouxiaGameJudgeCard(ctx, next) {
    const result = await youxiaService.getGameJudgeCard();
    ctx.body = result;
  }
}

module.exports = new youxiaController();
